package com.guxingke.gblog.dao.impl;

import java.util.List;

import com.guxingke.gblog.dao.FriendLinkDao;
import com.guxingke.gblog.dmo.FriendLink;

public class FriendLinkDaoImpl extends BaseDao implements FriendLinkDao {
	private FriendLinkDao dao = null;

	@Override
	public List<FriendLink> all() throws Exception {
		begin();
		dao = session.getMapper(FriendLinkDao.class);
		List<FriendLink> result = dao.all();

		end();
		return result;
	}

	@Override
	public void update(FriendLink friendLink) throws Exception {
		begin();
		dao = session.getMapper(FriendLinkDao.class);

		dao.update(friendLink);

		end();
	}

	@Override
	public void save(FriendLink friendLink) throws Exception {
		begin();
		dao = session.getMapper(FriendLinkDao.class);

		dao.save(friendLink);

		end();
	}

	@Override
	public void delete(Integer id) throws Exception {
		begin();
		dao = session.getMapper(FriendLinkDao.class);

		dao.delete(id);

		end();
	}

	@Override
	public FriendLink get(Integer id) throws Exception {
		begin();
		dao = session.getMapper(FriendLinkDao.class);

		FriendLink result = dao.get(id);

		end();

		return result;
	}

}
